// pages/orderProcessDetail/orderProcessDetail.js
var Define = require("../../lib/Define.js")

Page({
  data:{
    bean:{}
  },
  onLoad:function(options){
    var self = this

    var orderId = options.orderId
    var step = options.step

    wx.request({
      url: Define.value.baseUrl+"/order/orderprocess?orderId="+orderId+"&step="+step+"&bid="+Define.value.bid,
      data: {},
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      // header: {}, // 设置请求的 header
      success: function(res){
        // success
        var data = res.data
        console.log(data.data)
        if(data.code == 200){
          data.data.hasText = (data.data.user.action.indexOf("text") != -1)
          data.data.hasMsg = (data.data.user.action.indexOf("msg") != -1)
          data.data.hasImage = (data.data.user.action.indexOf("images") != -1)
          self.setData({
            bean:data.data
          })

          console.log(data.data)
        }
      },
      fail: function(res) {
        // fail
      },
      complete: function(res) {
        // complete
      }
    })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  onCallBtnClick:function(){
    Define.callServicePhone()
  }
})